Skip to content

BREAKING: Update to react-dom 18 client changes#1186

Closed
ynagorny wants to merge 1 commit into
reactjs:masterfrom
ynagorny:react-dom-18
Closed

BREAKING: Update to react-dom 18 client changes#1186
ynagorny wants to merge 1 commit into
reactjs:masterfrom
ynagorny:react-dom-18

Conversation

@ynagorny

Copy link
Copy Markdown

Update to import react-dom/client package instead of react-dom as described in:

https://reactjs.org/docs/react-dom.html

This takes care of this react 18 warning:

You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".

@justin808

Copy link
Copy Markdown
Collaborator

@ynagorny

This seems to be a breaking change for those that don't upgrade to React 18.

Please confirm.

Do you want to propose a solution that works with React 16+17 and React 18?

@justin808 justin808 marked this pull request as draft August 10, 2022 05:11
@justin808 justin808 changed the title Update to react-dom 18 client changes BREAKING: Update to react-dom 18 client changes Aug 10, 2022
@maedi

maedi commented Aug 15, 2022

Copy link
Copy Markdown

Functions like ReactDOM.hydrate are still in the core library, only createRoot and hydrateRoot are in react-dom/client (see: https://github.com/facebook/react/blob/main/packages/react-dom/client.js).

I've created a PR (#1194) which uses the correct core/client APIs and attempts to provide backwards compatibility for React 16/17. Can someone test?

@justin808

Copy link
Copy Markdown
Collaborator

Closed in favor of #1194.

@justin808 justin808 closed this Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants